﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace HustQQModel
{
    public class FileInformation
    {
        public FileInformation(string fileName, long fileSize, Guid fileId,string sendQQ,string recvQQ)
        {
            this.fileName = fileName;
            this.fileSize = fileSize;
            this.fileId = fileId;
            this.sendQQ = sendQQ;
            this.receiveQQ = recvQQ;
        }
        public FileInformation(string fp)
        {
            FilePath = fp;
        }
        private string filePath;

        public string FilePath
        {
            get { return filePath; }
            set 
            {
                filePath = value;
                if (File.Exists(filePath))
                {
                    FileInfo fi = new FileInfo(filePath);
                    fileSize = fi.Length;
                    fileName = fi.Name;
                    fileId = Guid.NewGuid();
                }
            }
        }
        private long fileSize;

        public long FileSize
        {
            get { return fileSize; }
            set { fileSize = value; }
        }
        private string fileName;

        public string FileName
        {
            get { return fileName; }
            set { fileName = value; }
        }
        private Guid fileId;

        public Guid FileId
        {
            get { return fileId; }
            set { fileId = value; }
        }
        private string sendQQ;

        public string SendQQ
        {
            get { return sendQQ; }
            set { sendQQ = value; }
        }
        private string receiveQQ;

        public string ReceiveQQ
        {
            get { return receiveQQ; }
            set { receiveQQ = value; }
        }
    }
}
